import { orderSort } from "./01_orderSort";
import { binarySort } from "./02_binarySort";

const MAX_LENGTH = 1000000;
const nums = new Array(MAX_LENGTH).fill(0).map((_, index) => index);
const num = MAX_LENGTH / 2;

const startTime = performance.now();
const index = orderSort<number>(nums, num);
const endTime = performance.now();

console.log("索引的位置:", index, "消耗的时间:", endTime - startTime);

const startTime1 = performance.now();
const index1 = binarySort(nums, num);
const endTime1 = performance.now();
console.log("索引的位置:", index1, "消耗的时间:", endTime1 - startTime1);
